import java.util.ArrayList;
import java.util.List;

/**
* @description: 816. 模糊坐标
* @author hewei
* @date 2022/8/30 15:37
* @version 1.0
*/

public class AmbiguousCoordinates {

    public static void main(String[] args) {
        System.out.println(String.valueOf("0.0"));
    }

    public List<String> ambiguousCoordinates(String s) {
        s = s.substring(1, s.length() - 1);
        List<String> ans = new ArrayList<>();
        for (int i = 0; i < s.length() - 1; i++) {
            String s1 = s.substring(0, i + 1);
            String s2 = s.substring(i + 1);
            List<String> temp1 = new ArrayList<>();
            List<String> temp2 = new ArrayList<>();
            boolean[] res1 = process(s1, temp1);
            boolean[] res2 = process(s2, temp2);
            for (int j = 0; j < res1.length; j++) {
                for (int k = 0; k < res2.length; k++) {
                    if (res1[j] && res2[k]) ans.add("(" + temp1.get(j) + ", " + temp2.get(k) + ")");
                }
            }
        }
        return ans;
    }

    public boolean[] process(String s, List<String> temp) {
        boolean[] res = new boolean[s.length()];
        temp.add(s);
        res[0] = check(s);
        for (int i = 0; i < s.length() - 1; i++) {
            String s1 = s.substring(0, i + 1);
            String s2 = s.substring(i + 1);
            temp.add(s1 + "." + s2);
            res[i + 1] = check(temp.get(temp.size() - 1)) && Integer.parseInt(s2) != 0;
        }
        return res;
    }

    public boolean check(String s) {
        String[] split = s.split("\\.");
        if (split.length == 1) {
            if (Integer.parseInt(s) == 0 && s.length() != 1) return false;
            return Integer.parseInt(s) == 0 || s.charAt(0) != '0';
        } else {
            if (!check(split[0])) return false;
            return check(new StringBuilder(split[1]).reverse().toString());
        }
    }
}
